credit1: avoid boosting vCPUs being "just" migrated
authorDario Faggioli <dario.faggioli@citrix.com>
Mon, 29 Feb 2016 14:58:49 +0000 (15:58 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 29 Feb 2016 14:58:49 +0000 (15:58 +0100)
commit66c7449a4daee7a36f31635fd95c37d8f381c529
treedd3a9051dc46cb54db561d031cb77c44c8c837b5
parent42391c613d42248d82f1b04c523d48bf141b75dc
credit1: avoid boosting vCPUs being "just" migrated

Moving a vCPU to a different pCPU means offlining it and
then waking it up, on the new pCPU. Credit1 grants BOOST
priority to vCPUs that wakes up, with the aim of improving
I/O latency. The net effect of this all is that vCPUs get
boosted when migrating, which shouldn't happen.

For instance, this causes scheduling anomalies and,
potentially, performance problems, as reported here:
  http://lists.xen.org/archives/html/xen-devel/2015-10/msg02851.html

This patch fixes this by noting down (by means of a flag)
the fact that the vCPU is about to undergo a migration.
This way we can tell, later, during a wakeup, whether the
vCPU is migrating or unblocking, and decide whether or
not to apply the boosting.

Note that it is important that atomic-safe bit operations
are used when manipulating vCPUs' flags. Take the chance
and add a comment about this.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit.c